@font-face {
  font-family: 'PUSAB';
  src: url('PUSAB.otf') format('opentype');
}

:root {
  --primary: #2196F3;
  --secondary: #FFC107;
  --bg: #000000;
  --text: #ffffff;
  --card-radius: 15px;
  --aero-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

header {
  background: rgba(255, 255, 255, 0.1);
  padding: 1rem;
  box-shadow: var(--aero-shadow);
  backdrop-filter: blur(10px);
}

h1 {
  text-align: center;
  color: var(--primary);
  font-weight: 800;
  margin-bottom: 1rem;
  font-family: 'PUSAB', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  letter-spacing: 2px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

nav {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

button {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: white;
  color: var(--text);
}

button.active {
  background: var(--primary);
  color: white;
}

.primary-btn {
  background: var(--primary);
  color: white;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
}

main {
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

section {
  display: none;
  animation: fadeIn 0.3s ease;
}

section.active {
  display: block;
}

.card-preview {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
}

.uno-card {
  width: 240px;
  height: 360px;
  background: white;
  border-radius: var(--card-radius);
  box-shadow: var(--aero-shadow);
  padding: 1rem;
  position: relative;
  transition: all 0.3s ease;
  cursor: grab;
  overflow: hidden; 
}

.uno-card:active {
  cursor: grabbing;
}

.uno-card.dragging {
  opacity: 0.5;
  cursor: grabbing;
}

.uno-card.shiny {
  position: relative;
  background-image: linear-gradient(
    45deg,
    rgba(255,255,255,0.2) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255,255,255,0.2) 50%,
    rgba(255,255,255,0.2) 75%,
    transparent 75%,
    transparent
  );
  background-size: 30px 30px;
  animation: shimmer 3s linear infinite;
}

.uno-card.shiny::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 20%,
    rgba(255,255,255,0.4) 25%,
    transparent 30%
  );
  animation: holographicShine 2s linear infinite;
  pointer-events: none;
}

.uno-card.rainbow {
  background-image: linear-gradient(
    45deg,
    #ff0000,
    #ff7f00,
    #ffff00,
    #00ff00,
    #0000ff,
    #4b0082,
    #8f00ff
  );
  background-size: 700% 700%;
  animation: rainbow-bg 5s linear infinite;
}

.uno-card.dual-color {
  background-image: linear-gradient(
    135deg,
    var(--color1) 0%,
    var(--color1) 50%,
    var(--color2) 50%,
    var(--color2) 100%
  );
}

.uno-card.dual-color::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255,255,255,0.1) 0%,
    transparent 50%,
    rgba(0,0,0,0.1) 100%
  );
  pointer-events: none;
}

.uno-card.colored-border {
  border: 8px solid var(--border-color);
  padding: calc(1rem - 8px); 
}

.uno-card.neon {
  box-shadow: 
    0 0 10px var(--neon-color),
    0 0 20px var(--neon-color),
    0 0 30px var(--neon-color),
    0 0 40px var(--neon-color);
  animation: neonPulse 1.5s ease-in-out infinite alternate;
}

.uno-card.background-image {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.uno-card.background-image .card-inner {
  background: rgba(0, 0, 0, 0.5);
  border-radius: inherit;
  margin: -1rem;
  height: calc(100% + 2rem);
}

.uno-card.tri-color {
  background-image: linear-gradient(
    to bottom,
    var(--color1) 0%,
    var(--color1) 33.33%,
    var(--color2) 33.33%,
    var(--color2) 66.66%,
    var(--color3) 66.66%,
    var(--color3) 100%
  );
}

.uno-card.tri-color::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(255,255,255,0.1) 0%,
    transparent 50%,
    rgba(0,0,0,0.1) 100%
  );
  pointer-events: none;
  border-radius: inherit;
}

.uno-card.shadow {
  background: linear-gradient(135deg, #1a1a1a, #000000);
  border: 2px solid rgba(128, 128, 128, 0.3);
}

.uno-card.shadow .card-inner {
  border-color: rgba(128, 128, 128, 0.3);
  color: rgba(255, 255, 255, 0.8);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.uno-card.shadow::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    transparent,
    rgba(255, 255, 255, 0.1)
  );
  border-radius: inherit;
  pointer-events: none;
}

.card-inner {
  height: 100%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: calc(var(--card-radius) - 5px);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
}

.card-controls {
  max-width: 400px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.1);
  padding: 2rem;
  border-radius: var(--card-radius);
  box-shadow: var(--aero-shadow);
  backdrop-filter: blur(10px);
}

.control-group {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

input, select, textarea {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.card-properties {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.property-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.5rem;
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  color: var(--text);
}

.merge-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

#onlineUsers {
  display: flex;
  gap: 1rem;
  padding: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.online-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.5rem;
  border-radius: 20px;
  box-shadow: var(--aero-shadow);
  color: var(--text);
}

.online-user img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
}

.card-container {
  position: relative;
  padding-bottom: 1.5rem;
}

.card-container::after {
  content: attr(data-username);
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.8rem;
  color: var(--text);
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.9);
  padding: 0.2rem 0.5rem;
  border-radius: 10px;
}

#sharedSection .card-grid {
  margin-top: 2rem;
}

#customSymbol {
  margin-top: 0.5rem;
}

.card-symbol, .card-function {
  font-size: 2em;
  font-weight: bold;
  text-align: center;
  word-break: break-word;
  max-width: 100%;
  margin: 10px 0;
  overflow-wrap: break-word;
  padding: 0 10px;
}

.card-function {
  font-size: clamp(1em, 2em, 2.5em);
  line-height: 1.2;
  white-space: pre-wrap;
  word-break: break-word;
  max-width: 100%;
  padding: 0 10px;
  text-align: center;
}

.notification {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--primary);
  color: white;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: var(--aero-shadow);
  animation: slideIn 0.3s ease;
  z-index: 1000;
}

/* Add audio controls styling */
.audio-controls {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 1000;
}

.audio-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  box-shadow: var(--aero-shadow);
}

.audio-btn:hover {
  transform: scale(1.1);
}

.audio-icon {
  font-size: 1.5rem;
}

.audio-btn.muted .audio-icon::before {
  content: '🔇';
}

.no-results {
  text-align: center;
  padding: 2rem;
  color: var(--text);
  font-style: italic;
}

#searchSection {
  max-width: 1200px;
  margin: 0 auto;
}

#cardSearch {
  width: 100%;
  padding: 1rem;
  margin-bottom: 2rem;
  border: 2px solid var(--primary);
  border-radius: var(--card-radius);
  font-size: 1.1rem;
  transition: all 0.3s ease;
}

#cardSearch:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.3);
}

.my-card-badge {
  position: absolute;
  top: -10px;
  right: -10px;
  background: var(--primary);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: bold;
  box-shadow: var(--aero-shadow);
  z-index: 1;
}

#chatSection {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 300px;
  height: 400px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  overflow: hidden;
}

.chat-header {
  padding: 1rem;
  background: var(--primary);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-header h3 {
  margin: 0;
}

#toggleChat {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 0.5rem;
}

.chat-messages {
  flex-grow: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.chat-message {
  padding: 0.5rem 1rem;
  border-radius: 15px;
  max-width: 80%;
  word-break: break-word;
}

.chat-message.sent {
  background: var(--primary);
  color: white;
  align-self: flex-end;
}

.chat-message.received {
  background: rgba(255, 255, 255, 0.2);
  color: var(--text);
  align-self: flex-start;
}

.message-meta {
  font-size: 0.7rem;
  margin-top: 0.2rem;
  opacity: 0.8;
}

.chat-input {
  padding: 1rem;
  border-top: 1px solid #ddd;
  display: flex;
  gap: 0.5rem;
}

.chat-input input {
  flex-grow: 1;
  padding: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.chat-input button {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 20px;
  padding: 0.5rem 1rem;
  cursor: pointer;
}

#chatSection.minimized {
  height: auto;
}

#chatSection.minimized .chat-messages,
#chatSection.minimized .chat-input {
  display: none;
}

.notification-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--secondary);
  color: var(--text);
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: bold;
}

#mergeSource, #mergeDest {
  min-height: 400px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: var(--card-radius);
  padding: 1rem;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1);
}

#mergeSource h3, #mergeDest h3 {
  margin-bottom: 1rem;
  color: var(--primary);
  text-align: center;
}

.dual-color-pickers {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.dual-color-pickers input[type="color"] {
  width: 45%;
}

.dual-color-pickers span {
  color: var(--text);
  font-weight: 500;
}

.secondary-btn {
  background: var(--secondary);
  color: var(--text);
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.secondary-btn:hover {
  filter: brightness(1.1);
}

.fusion-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.fusion-cards {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.1);
  padding: 2rem;
  border-radius: var(--card-radius);
}

.fusion-slot {
  width: 240px;
  height: 360px;
  border: 3px dashed rgba(255, 255, 255, 0.3);
  border-radius: var(--card-radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.fusion-slot.dragover {
  border-color: var(--primary);
  background: rgba(33, 150, 243, 0.2);
}

.fusion-slot h3 {
  margin-bottom: 1rem;
  color: var(--primary);
}

.fusion-placeholder {
  color: rgba(255, 255, 255, 0.5);
  font-style: italic;
}

.fusion-plus, .fusion-equals {
  font-size: 3rem;
  color: var(--primary);
  font-weight: bold;
}

.fusion-result {
  text-align: center;
}

.fusion-result h3 {
  margin-bottom: 1rem;
  color: var(--primary);
}

.available-cards-container {
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--card-radius);
  padding: 1rem;
  margin-top: 2rem;
}

.available-cards-container h3 {
  color: var(--primary);
  text-align: center;
  margin-bottom: 1rem;
}

.available-cards-container .card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  max-height: 500px;
  overflow-y: auto;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--card-radius);
}

.available-cards-container .card-container {
  position: relative;
}

.available-cards-container .uno-card {
  transform: scale(0.8);
  transition: transform 0.3s ease;
}

.available-cards-container .uno-card:hover {
  transform: scale(0.85);
  z-index: 1;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes shimmer {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 30px 30px;
  }
}

@keyframes rainbow-bg {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 100% 50%;
  }
}

@keyframes neonPulse {
  from {
    box-shadow: 
      0 0 10px var(--neon-color),
      0 0 20px var(--neon-color),
      0 0 30px var(--neon-color),
      0 0 40px var(--neon-color);
  }
  to {
    box-shadow: 
      0 0 5px var(--neon-color),
      0 0 10px var(--neon-color),
      0 0 15px var(--neon-color),
      0 0 20px var(--neon-color);
  }
}

@keyframes holographicShine {
  0% {
    transform: rotate(0deg) translate(-50%, -50%);
  }
  100% {
    transform: rotate(360deg) translate(-50%, -50%);
  }
}

@keyframes fusionGlow {
  0% { box-shadow: 0 0 10px var(--primary); }
  50% { box-shadow: 0 0 20px var(--primary); }
  100% { box-shadow: 0 0 10px var(--primary); }
}

.fusion-ready {
  animation: fusionGlow 2s infinite;
}

@media (max-width: 768px) {
  .merge-container {
    grid-template-columns: 1fr;
  }
  .fusion-cards {
    gap: 1rem;
  }
  
  .available-cards-container .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
}